package com.example.vertification.service;

import com.example.vertification.Utils.RedisUtil;
import com.example.vertification.entity.PageEntity;
import com.example.vertification.entity.Question;
import com.example.vertification.repository.PageRepository;
import com.example.vertification.repository.QuestionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class QuestionService {
    private final QuestionRepository questionRepository;


    @Autowired
    public QuestionService(QuestionRepository questionRepository) {
        this.questionRepository = questionRepository;
    }

    public Question getQuestion(long questionid) {
        return questionRepository.findByquestionId(questionid);
    }
    public List<Question> getAllQuestions() {
        return questionRepository.findAll();
    }

}